{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "import math,os\n",
    "from numpy.random import choice\n",
    "import scikitplot as skplt\n",
    "from time import time"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import warnings\n",
    "warnings.filterwarnings('ignore')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "pd.options.display.max_rows = 20\n",
    "pd.set_option('display.max_columns', None)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.linear_model import LinearRegression,Ridge,SGDRegressor,ElasticNet\n",
    "from sklearn.model_selection import train_test_split\n",
    "from sklearn.utils import shuffle\n",
    "from sklearn.utils.validation import check_array \n",
    "from sklearn.metrics import r2_score, mean_squared_error, mean_absolute_error\n",
    "from sklearn.svm import LinearSVR\n",
    "from sklearn.tree import DecisionTreeRegressor\n",
    "from sklearn.ensemble import RandomForestRegressor,ExtraTreesRegressor,GradientBoostingRegressor,AdaBoostRegressor,BaggingRegressor"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "historicalColumns,neighborColumns,neighborColumnsAggregated = [],[],[]\n",
    "\n",
    "for historical in range(5):\n",
    "    historicalColumns += ['Tminus'+str(historical+1)]\n",
    "\n",
    "for neighbor in range(26):\n",
    "    neighborColumns += ['T'+str(neighbor+1)+'_t-1']\n",
    "    \n",
    "for neighborDegree in range(3):\n",
    "        neighborColumnsAggregated += ['T_nbhDeg'+str(neighborDegree+1)+'_t-1']\n",
    "\n",
    "columns = ['voxelLat','voxelLong','voxelVert','voxelType','timestep','x_voxel','y_voxel','z_voxel','layerNum','time_creation', 'time_elapsed', 'x_laser','y_laser','z_laser','x_distance','y_distance','z_distance','euclidean_distance_laser'] + historicalColumns+ neighborColumns + neighborColumnsAggregated + ['T_self']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "53"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(columns)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "def roundup(a, digits=4):\n",
    "    n = 10**-digits\n",
    "    return round(math.ceil(a / n) * n, digits)\n",
    "\n",
    "def isEven(num):\n",
    "    if num%2 ==0:\n",
    "        return True\n",
    "    return False\n",
    "\n",
    "def modLog(num):\n",
    "    try:\n",
    "        return log(num)\n",
    "    except:\n",
    "        return 0\n",
    "\n",
    "def loadNumpy(name,path='.'):\n",
    "    if \".npy\" in name:\n",
    "        fullPath = path+'/'+name\n",
    "    else:\n",
    "        fullPath = path+'/'+name+'.npy'\n",
    "    return np.load(fullPath, allow_pickle=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "#featureColumns = ['timestep','x_distance','y_distance','z_distance','layerNum','Tminus1','Tminus2']+neighborColumns\n",
    "featureColumns = ['timestep','x_distance','y_distance','z_distance','time_elapsed'] + historicalColumns + neighborColumns\n",
    "\n",
    "featureDisplay = featureColumns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "36"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(featureColumns)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "def plot_feature_importances(et):\n",
    "    skplt.estimators.plot_feature_importances(et,text_fontsize=16,max_num_features=6,figsize=(24,4),feature_names=featureDisplay)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "def mean_absolute_percentage_error(y_true, y_pred):\n",
    "\t'''\n",
    "\tscikit(sklearn) does not have support for mean absolute percentage error MAPE.\n",
    "\tThis is because the denominator can theoretically be 0 and so the value would be undefined.\n",
    "\tSo this is our implementation\n",
    "\t'''\n",
    "# \ty_true = check_array(y_true)\n",
    "# \ty_pred = check_array(y_pred)\n",
    "\n",
    "\treturn np.mean(np.abs((y_true - y_pred) / y_true)) * 100\n",
    "\n",
    "def r2(y_true,y_pred):\n",
    "    return roundup(r2_score(y_true,y_pred))\n",
    "\n",
    "def mse(y_true,y_pred):\n",
    "    return roundup(mean_squared_error(y_true,y_pred))\n",
    "\n",
    "def mae(y_true,y_pred):\n",
    "    return roundup(mean_absolute_error(y_true,y_pred))\n",
    "\n",
    "def mape(y_true, y_pred):\n",
    "    return roundup(mean_absolute_percentage_error(y_true,y_pred))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "def combineDataFrames(prefix,columns=columns):\n",
    "    List = []\n",
    "    nums_start,nums_stop = [],[]\n",
    "    for item in os.listdir('../data/cube-20-20-10-800-processed'):\n",
    "        if \"cubeAgg-20-20-10-800_\" in item and \".npy\" in item:\n",
    "            timeStep_start = int(item.split('cubeAgg-20-20-10-800_')[1].split('_')[0])\n",
    "            nums_start += [timeStep_start]\n",
    "            \n",
    "            timeStep_stop = int(item.split('_')[2].split('.npy')[0])\n",
    "            nums_stop += [timeStep_stop]\n",
    "            \n",
    "    nums_start = sorted(nums_start)\n",
    "    nums_stop = sorted(nums_stop)\n",
    "    \n",
    "#     print (nums_start)\n",
    "#     print (nums_stop)\n",
    "    \n",
    "    array = loadNumpy('../data/cube-20-20-10-800-processed/'+prefix+'_'+str(nums_start[0])+'_'+str(nums_stop[0])+'.npy')\n",
    "    for i in range(1,len(nums_start)):\n",
    "        newFile = '../data/cube-20-20-10-800-processed/'+prefix+'_'+str(nums_start[i])+'_'+str(nums_stop[i])+'.npy'\n",
    "        array = np.append(array,loadNumpy(newFile),axis=0)\n",
    "    return pd.DataFrame(array,columns=columns)\n",
    "\n",
    "\n",
    "# def combineDataFrames(columns=columns):\n",
    "#     dir = './temp/'\n",
    "#     array = loadNumpy(dir+'file1.npy')\n",
    "#     array = np.append(array,loadNumpy(dir+'file2.npy'),axis=0)\n",
    "    \n",
    "#     return pd.DataFrame(array,columns=columns)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "# df_big = combineDataFrames('data_big')\n",
    "df_big = combineDataFrames('cubeAgg-20-20-10-800')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(9705190, 53)"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_big.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_train = df_big[df_big['timestep'] < 200.0]\n",
    "df_test = df_big[(df_big['timestep'] >= 200.0) & (df_big['timestep'] < 1200.0)]\n",
    "\n",
    "\n",
    "X_train = df_train.loc[:,featureColumns]\n",
    "y_train = df_train['T_self']\n",
    "\n",
    "X_test = df_test.loc[:,featureColumns]\n",
    "y_test = df_test['T_self']\n",
    "\n",
    "X_train,y_train = shuffle(X_train,y_train,random_state=300)\n",
    "X_test,y_test = shuffle(X_test,y_test,random_state=300)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(0.8276, 4.846)"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "et_500 = ExtraTreesRegressor(n_estimators=5, n_jobs=-1, random_state=300)\n",
    "et_500.fit(X_train,y_train)\n",
    "predicted = et_500.predict(X_test)\n",
    "r2(y_test,predicted) ,mape(y_test,predicted)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAABW0AAAEPCAYAAAA55ObxAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAHYdJREFUeJzt3XuUZWV5J+DfK+0N4ygEshzUtiUSEUzGyeBEo0kq6CTRKOTmyk0jOkGdmWgyuZnbAkSzMhkvcRyTiJdoAo46QSI43h1oEwWNaNSAiuEqCgkgrQgS5PLOH/vUcKhUd53TVd21u+p51jqreu+zv73fOvWdrl2/8+1vV3cHAAAAAIBxuNt6FwAAAAAAwJ2EtgAAAAAAIyK0BQAAAAAYEaEtAAAAAMCICG0BAAAAAEZEaAsAAAAAMCJCWwAAAACAERHaAgCwU1V1eVXdXFU3Tj0OWeU+F6rqS2tV44zHfFNVvWRvHnNnquqkqjptvesAAGC8hLYAAKzkqd39LVOPq9azmKrasp7HX419uXYAAPYeoS0AALulqh5TVedW1Ver6tNVtTD13LOq6nNV9fWqurSqnjtZf58k70lyyPTI3aUjYZeOxp2M+H1hVX0myU1VtWXS7u1VdW1VXVZVL5ix7m1V1ZMar6yqHVX1vKp6dFV9ZvL9vHpq++Oq6iNV9eqq+lpVfb6qnjD1/CFVdVZVXV9VF1fV8VPPnVRVp1fVaVV1Q5LnJfmdJD89+d4/vavXa/q1qKpfq6prqurqqnrW1PP3rqqXV9UVk/o+XFX3XulnBADAePmkHwCAuVXVA5O8K8kzkrw3yROSvL2qDu/ua5Nck+QpSS5N8v1J3lNVH+/uT1bVk5Kc1t0PmtrfLIf92SQ/muS6JHckeWeSMyfrH5Tkg1V1UXe/b8Zv43uSHDap76zJ9/HEJHdP8ndV9Zfd/aGpbU9PclCSn0hyRlU9tLuvT/LWJBck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GaZD+O0MNx7+73McUt9nUxPawj6mu2+rqmOT/HGSN2WYA/SVGe7SfOLUph/JMK/iMzLMGXpVktOWbHNkkr9ccojF5RdluOwEZvFt2Xlf+vMkx03+fWuG6Tmem+S+GT6AODnJ/5jnYN39lar6pQx3JP9Qkv0yjG7cvotmv5S7zn34tMkjSR4an9YzPv8nyZ9k+GDuhAx/6Kw0H+6fJnnI1PJJk69XZPgDBva0CzOcezwowwfKVyZ5TZIXT66ymJX+z5jNet5zYYYPq4/LcNPVryQ5O8mLuvuiWQ/mvIcRmanvd/cdVfWUDFcZ/UmGe7Scl+QHJ/M6z0TfZ7OrYdpLAAAAAADG4G4rbwIAAAAAwN5iegQARqWq9suuL4G9o7vv2Fv1wJ4wuYHkrtzeLodig9L/4U7Oe9is9H1YmZG2AIzNJRnmvt3Z44T1Kw1Wb3Jjsl318Vtz500iYUPR/+FfcN7DZqXvwwrMaQvAqFTVd2a4ec3OXNXdV+2temCtVdU9knzXCpvt8s7IsK/S/+GunPewWen7sDKhLQAAAADAiJgeAQAAAABgRIS2AAAAAAAjIrQFAAAAABgRoS0AAAAAwIgIbQEAAAAARuT/Af2jHhzfs8H1AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 1728x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plot_feature_importances(et_500)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
